package com.nowcoder.community.config;/**
 * 功能描述
 *
 * @author 21775
 * @date 2022/09/29  16:30
 */

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import java.io.File;

/**
 *@ClassName WkConfig
 *@Description TODO wk创建目录
 *@Author 21775
 *@Date 2022/9/29 16:30
 *@Version 1.0
 */
@Configuration
@Slf4j
public class WkConfig {
    @Value("${wk.image.storage}")
    private String wkImageStorageUrl;

    @PostConstruct
    public void init(){
        File file=new File(wkImageStorageUrl);

        if(!file.exists()){
            file.mkdir();
            log.info("创建目录："+wkImageStorageUrl);
        }
    }
}
